.fx-select {
  box-sizing: border-box;
  width: $input-width-default;
  display: inline-block;
  border: 1px solid $border-color-default;
  border-radius: $border-radius-default;
  position: relative;
  color: $font-color-default;
  cursor: pointer;
  user-select: none;

  &.clear:hover {
    border-color: $border-color-important;

    > .select-icon {
      > .fx-select-dropdown {
        display: none;
      }

      > .select-clear {
        display: inline-block;
      }
    }
  }

  &.active {
    border-color: $color-primary;
  }

  &.disabled {
    > input {
      background-color: $color-disabled-background;
      cursor: not-allowed;
      color: $font-color-lowest;
    }

    > .select-icon {
      color: $font-color-lowest;
    }
  }

  > input {
    width: 100%;
    color: $font-color-default;
    border-radius: $border-radius-default;
    display: inline-block;
    box-sizing: border-box;
    padding: 0 30px 0 10px;
    cursor: pointer;
    background-color: $color-white;

    &.multiple {
      position: absolute;
      z-index: -1;
      color: transparent !important;
      height: 100% !important;
    }

    &.large {
      height: $height-large;
      line-height: $height-large;
    }

    &.middle {
      height: $height-middle;
      line-height: $height-middle;
    }

    &.default {
      height: $height-default;
      line-height: $height-default;
    }

    &.mini {
      height: $height-mini;
      line-height: $height-mini;
    }
  }

  > .select-icon {
    display: flex;
    color: $font-color-default;
    justify-content: center;
    align-items: center;
    position: absolute;
    right: 0;
    top: 0;
    width: 25px;
    height: 100%;
    text-align: center;

    > .select-clear {
      display: none;
    }
  }

  > .select-content {
    position: fixed;
    left: 0;
    overflow: hidden;
    padding: 10px 0;

    > .select-content-arrow {
      transform-origin: center top;
      transition: all 0.15s;

      &::after {
        content: '';
        position: absolute;
        top: -11px;
        left: 35px;
        display: block;
        width: 0;
        height: 0;
        border-color: transparent;
        border-style: solid;
        margin-right: 3px;
        border-bottom-color: $color-white;
        border-width: 6px;
        filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .03));
      }

      &.top {
        &::after {
          border-bottom-color: transparent;
          border-top-color: $color-white;
          top: auto;
          bottom: -11px;
        }
      }

      > ul {
        width: 100%;
        max-height: 200px;
        border-radius: $border-radius-default;
        overflow-y: auto;
        border: 1px solid $border-color-default;
        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
        box-sizing: border-box;
      }
    }
  }

  > .fx-select-multiple {
    padding-right: 30px;
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;

    &.large {
      min-height: $height-large;
    }

    &.middle {
      min-height: $height-middle;
    }

    &.default {
      min-height: $height-default;
    }

    &.mini {
      min-height: $height-mini;
    }

    > span, em {
      display: inline-block;
      max-width: calc(100% - 30px);
      background-color: $color-white-secondary;
      border: 1px solid #e9e9eb;
      border-radius: 4px;
      color: #909399;
      height: 24px;
      padding: 0 20px 0 8px;
      margin: 4px 0 2px 6px;
      line-height: 22px;
      position: relative;

      &.collapse {
        max-width: calc(100% - 80px);
      }

      > i {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);

        &:hover {
          color: $color-error;
        }
      }
    }

    em {
      padding-right: 8px;
    }
  }
}

.fx-select-option {
  background-color: $color-white;
  font-size: 14px;
  padding: 0 20px;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #606266;
  height: 34px;
  line-height: 34px;
  box-sizing: border-box;
  cursor: pointer;

  &:hover {
    background-color: $border-color-lowest;
  }

  &.active {
    background-color: $border-color-lowest;
    color: $color-primary;
  }

  &.disabled {
    background-color: $color-white;
    cursor: not-allowed;
    color: $font-color-lowest;
  }
}
